import java.awt.Graphics;
import java.util.ArrayList;


public class Flying
{
	ArrayList<Bullet> bullets;
	
	public Flying()
	{
		bullets = new ArrayList<Bullet>();
	}
	
	public void addBullet(Bullet bull)
	{
		bullets.add(bull);
	}
	
	public void move()
	{
		for(int k = 0; k < bullets.size(); k++)
		{
			bullets.get(k).move();
			if(bullets.get(k).getX() < 0 || bullets.get(k).getX() > 600 || bullets.get(k).getY() < 0 || bullets.get(k).getY() > 600)
			{
				bullets.remove(k);
				k--;
			}
		}
	}
	
	public void drawBullets(Graphics g)
	{
		for(int k = 0; k < bullets.size(); k++)
		{
			g.drawImage(bullets.get(k).getImage(), bullets.get(k).getX(), bullets.get(k).getY(), null);
		}
	}
}
